package com.hunan.api.catv.action.wx;

import com.hunan.api.catv.action.BaseAction;
import com.hunan.api.catv.common.Api;
import com.hunan.api.catv.entity.Result;
import com.hunan.api.catv.service.biz.wx.WxBiz;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @author jiang zhuan
 * @version 1.0
 * @description 描述
 * @date 2021/9/2 0002
 * @package com.hunan.api.catv.action.wx
 * @company 湖南有线
 */
@RestController
@RequestMapping(Api.wx)
public class WxAction extends BaseAction {
    @Autowired
    WxBiz wxBiz;

    @GetMapping("/web/auth")
    public Result webAuthorization(String code) {
        return buildOK(wxBiz.webAuthorization(code), "");
    }


    @PostMapping("/web/sign")
    public Result webSign(HttpServletRequest request, String url, String ticket) {
        return buildOK(wxBiz.webSign(url), "");
    }

}
